package com.ld.security.server.user.modules.dsp.api;


import com.ld.security.common.mybatis.base.vo.DataVo;
import com.ld.security.common.tomcat.anno.AjaxLogKey;
import com.ld.security.common.tomcat.base.api.SuperApi;
import com.ld.security.server.user.modules.dsp.entity.DspDispatchEntity;
import com.ld.security.server.user.modules.dsp.po.UpdateDispatchStatusPo;
import com.ld.security.server.user.modules.dsp.service.IDspDispatchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


@RestController
@Api(tags="广告调度Api管理")
@RequestMapping("/api/dspDispatch")
public class DspDispatchApi  extends SuperApi<DspDispatchEntity>{


        @Autowired
        IDspDispatchService iDspDispatchService;

        @AjaxLogKey
        @ApiOperation("批量修改调度状态")
        @RequestMapping(value = "/updateDispatchStatus",method = RequestMethod.POST)
        public DataVo updateDispatchStatus(@RequestBody @Valid UpdateDispatchStatusPo po){
                int total = iDspDispatchService.updateDispatchStatusPo(po);

                return DataVo.ofMsg("共修改:"+total+"条数据");
        }



}
